//
//  HACNodesComponentTecs.h
//  Pods
//
//  Created by silver on 2018/10/13.
//
//

#import "HACNodesComponent.h"
#import "HACTecNode.h"

extern NSString *HACNodesComponentMainNodeKey;
extern NSString *HACNodesComponentTecNodeKey;

@interface HACTecInfoBar : UIView
@property (nonatomic, strong) UIButton *titleButton;
@property (nonatomic, strong) UILabel *infoLabel;
@property (nonatomic, strong) NSAttributedString *infoString;
@end

@class HACNodesComponentTecs;
@protocol HACNodesComponentTecsDelegate <HACNodesComponentDelegate>
@optional
- (void)tecButtonTouchedNodeComponent:(HACNodesComponent*)component withIndex:(NSInteger)index;
- (void)tecChangeNodeComponent:(HACNodesComponent*)component withIndex:(NSInteger)index oldType:(HACTecType)oldType newType:(HACTecType)newType;

@end

@interface HACNodesComponentTecs : HACNodesComponent
@property (nonatomic, strong) NSArray<NSNumber*> *tecNodeTypes;
@property (nonatomic, strong) NSArray<NSNumber*> *orderSwitchTecNodeTypes;
@property (nonatomic, assign) BOOL isSoildFill; /** 是否实心 */
@property (nonatomic, copy) NSDictionary<NSNumber*, NSArray<NSNumber*>*> *tecParamDic;//指标参数，<@(HACTecType), @[]>
@property (nonatomic, strong) NSMutableArray<HACTecInfoBar*> *tecBars;
@property (nonatomic, weak) id<HACNodesComponentTecsDelegate> delegate;

//指标bar button点击事件
- (void)tecButtonClick:(UIButton*)sender ;
//更新指标bar信息
- (void)updateTecBar:(HACTecInfoBar*)bar withType:(HACTecType)type ;
//顺序切换,下一个指标
- (HACTecType)nextTecTypeWithNowType:(HACTecType)nowType ;

- (void)refreshTecbarInfoAtIndex:(NSInteger)index ;

- (void)setTec:(HACTecType)tecType withParam:(NSArray<NSNumber*>*)param;

/**
 设置幅图切换类型顺序

 @param orderSwitchTecNodeTypes 幅图类型顺序
 @param showBtn 是否显示幅图切换btn
 */
- (void)setOrderSwitchTecNodeTypes:(NSArray<NSNumber *> *)orderSwitchTecNodeTypes showTecBtn:(BOOL)showBtn;
@end

